Of Exactitude in Science
…In that Empire, the craft of Cartography attained such Perfection that the Map of a Single province covered the space of an entire City, and the Map of the Empire itself an entire Province. In the course of Time, these Extensive maps were found somehow wanting, and so the College of Cartographers evolved a Map of the Empire that was of the same Scale as the Empire and that coincided with it point for point. Less attentive to the Study of Cartography, succeeding Generations came to judge a map of such Magnitude cumbersome, and, not without Irreverence, they abandoned it to the Rigours of sun and Rain. In the western Deserts, tattered Fragments of the Map are still to be found, Sheltering an occasional Beast or beggar; in the whole Nation, no other relic is left of the Discipline of Geography.
—From Travels of Praiseworthy Men (1658) by J. A. Suarez Miranda
borges is a small data visualization
package that allows you to plot your single cell RNA-seq dataset as an
antique or modern cartographic atlas.
This is all done through the use of oveRlay,
ggplot2 and a few other libraries.
To install borges you will need to
install first oveRlay.
Use remotes::install_github() or
devtools::install_github() as follows:
remotes::install_github("gdagstn/oveRlay")
remotes::install_github("gdagstn/borges")
borges has only two functions:
prepAtlas() to prepare the atlas coordinates from a
SingleCellExperiment object, and plotAtlas()
to display it as a ggplot2 plot.
For a practical demonstration, let’s download a SingleCellExperiment
object using the scRNAseq BioConductor package:
zeisel = scRNAseq::ZeiselNervousData()
The Zeisel dataset has an “unnamed” reducedDim slot that
contains a t-SNE embedding for cells of the nervous system.
zeiselatlas = prepAtlas(zeisel,
dimred = "unnamed",
res = 400,
labels = "TaxonomyRank3",
as_map = TRUE)
plotAtlas(zeiselatlas, as_map = FALSE)